(** types for the basic abstract syntax of a Gnarly program*)

type gnexp = 
	  Integer of int
	| Real of float
	| Boolean of bool
	| Char of char
	| Identifier of string
	| Nil
	| Lambda of string list * gntype * gnexp
	| Application of gnexp * gnexp list
	| Let of ((string * gntype) * gnexp) list * gnexp
	| Commit of ((string * gntype) * gnexp) list
	| Sequence of gnexp * gnexp
	| Conditional of gnexp * gnexp * gnexp * bool
	| Match of gnexp * ((string list) * gnexp) list * gnexp * bool
and environment = Env of ((string * (gnvalue ref)) list)
and type_env = TEnv of ((string * (gntype ref)) list)
and gnvalue =
	  R of float
	| I of intval
	| B of bool
	| Ch of char
	| C of gnvalue * gnvalue
	| N
	| F of string list * gntype * gnexp * ((environment ref) ref)
	| PF of ((environment ref) -> gnexp list -> gnexp -> gnvalue)
	| Type_Error of string
and intval = 
	  IVal of int
	| INaN
and gntype = 
	  Basic_Type of string
	| Dynamic_Type
	| Arrow_Type of gntype list * gntype
	| Product_Type of gntype list
	| List_Type of contents
	| Type_Variable of string
	| Exclusive_Type_Variable of string * gntype list
	| Static_Type_Error of string
and contents = 
	  List of gntype
	| Empty_List

type gnarly = 
	  Empty
	| Expression of gnexp
	| Library of string
	| Syntax_Error

(*val extend_env environment -> string -> gnexp -> (environment ref)*)

